package com.example.ResumeWorkPlatform.dao;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 
 * @ClassName:  GerdenEntity
 * @Description: 工业园区实体
 * @Copyright: smartlab411
 * @Author chengwenixng
 * @Date 2020-3-29 1:23
 */

@Entity
@Table(name = "gerden_entity")
public class  GerdenEntity implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	/**
	 * 工业园区名字
	 */
	private String gerdenName;
	
	/**
	 * 创建时间
	 */
	private Date createTime = new Date();
	
	/**
	 * 删除标识符
	 */
	private boolean delFlag = true;

	/**
	 * 工业园和用户（一对多）;
	 */
	@OneToMany(mappedBy = "gerdenEntity", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private List<BasicUserEntity> basicUserEntities= new ArrayList<>();
	/**
	 * 工业园和考勤（一对多）;
	 */
	@OneToMany(mappedBy = "gerdenEntity", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private List<BoardEntity> gBoardEntities= new ArrayList<>();
	
	/**
	 * 工业园和部门（一对多）;
	 */
	@OneToMany(mappedBy = "gerdenEntity", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private List<DepartmentEntity> departmentList = new ArrayList<>();

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getGerdenName() {
		return gerdenName;
	}

	public void setGerdenName(String gerdenName) {
		this.gerdenName = gerdenName;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public boolean isDelFlag() {
		return delFlag;
	}

	public void setDelFlag(boolean delFlag) {
		this.delFlag = delFlag;
	}

	public List<BasicUserEntity> getBasicUserEntities() {
		return basicUserEntities;
	}

	public void setBasicUserEntities(List<BasicUserEntity> basicUserEntities) {
		this.basicUserEntities = basicUserEntities;
	}

	public List<BoardEntity> getgBoardEntities() {
		return gBoardEntities;
	}

	public void setgBoardEntities(List<BoardEntity> gBoardEntities) {
		this.gBoardEntities = gBoardEntities;
	}

	public List<DepartmentEntity> getDepartmentList() {
		return departmentList;
	}

	public void setDepartmentList(List<DepartmentEntity> departmentList) {
		this.departmentList = departmentList;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((basicUserEntities == null) ? 0 : basicUserEntities.hashCode());
		result = prime * result + ((createTime == null) ? 0 : createTime.hashCode());
		result = prime * result + (delFlag ? 1231 : 1237);
		result = prime * result + ((departmentList == null) ? 0 : departmentList.hashCode());
		result = prime * result + ((gBoardEntities == null) ? 0 : gBoardEntities.hashCode());
		result = prime * result + ((gerdenName == null) ? 0 : gerdenName.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		GerdenEntity other = (GerdenEntity) obj;
		if (basicUserEntities == null) {
			if (other.basicUserEntities != null)
				return false;
		} else if (!basicUserEntities.equals(other.basicUserEntities))
			return false;
		if (createTime == null) {
			if (other.createTime != null)
				return false;
		} else if (!createTime.equals(other.createTime))
			return false;
		if (delFlag != other.delFlag)
			return false;
		if (departmentList == null) {
			if (other.departmentList != null)
				return false;
		} else if (!departmentList.equals(other.departmentList))
			return false;
		if (gBoardEntities == null) {
			if (other.gBoardEntities != null)
				return false;
		} else if (!gBoardEntities.equals(other.gBoardEntities))
			return false;
		if (gerdenName == null) {
			if (other.gerdenName != null)
				return false;
		} else if (!gerdenName.equals(other.gerdenName))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	
}

